/*-----------------------------------------------File Info------------------------------------------------
** File Name:               I2cWR.h
** Last modified date:      20222620
** Last version:            V0.1
** Description:             
**--------------------------------------------------------------------------------------------------------            
** Created date:            20220620
** author:                  YLY
** Version:                 V0.1
** Descriptions:            键盘扫描处理函数
**--------------------------------------------------------------------------------------------------------
*/

#ifndef _I2C_W_R_H_
#define	_I2C_W_R_H_

#include "userConfig.h"

/* 定义i2c从机地址7位地址 0x00-0x7F ,默认使用地址0*/
#define KEY_I2C_SLAVE_ADDR0				0x37
#define	KEY_CLK_RATE 					400000u	//400K	AIP5916推荐不超过20K

//#define I2CWR_DGB GLOBAL_DBG
#ifndef I2CWR_DGB
	#define I2CWR_DGB(...)
#endif

#define I2CWR_ERR GLOBAL_ERR
#ifndef I2CWR_ERR
	#define I2CWR_ERR(...)
#endif



typedef enum
{
	I2C_WR_IDLE,
	I2C_WR_SUCCESS,
	I2C_WR_FAIL
}teI2cWRFeedback;

extern tsCfgI2c gtCfgI2cKey;

extern uint8_t i2cWriteReg(uint8_t addr, uint8_t reg, uint8_t *pValue, uint8_t num);
extern uint8_t i2cReadReg(uint8_t addr, uint8_t reg, uint8_t *pValue, uint8_t num);
extern void i2cWRInit(void);
#endif	//	_AIP59XX_H_








